From: Carlos Garnacho Date: Tue, 30 Dec 2025 12:24:41 +0000 (+0100) Subject: workspaceAnimation: Perform a grab during workspace switch gestures X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~39^2~1^2~64 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c336fb4264afd295b92be9aa4d599976a5885b83;p=gnome-shell.git workspaceAnimation: Perform a grab during workspace switch gestures Currently, the mechanism to reclaim touch input from clients and into the gesture is somewhat indirect: - The swipeTracker gesture(s) will enter in a recognized state - The MetaGestureTracker will notice the recognized state on a gesture set up in the ClutterStage actor, and emit META_SEQUENCE_ACCEPTED on the sequence - The core will notice the sequence being accepted and call meta_display_cancel_touch()/meta_wayland_touch_cancel() - This eventually results in wl_touch.cancel on the affected client(s) This is a bit too convoluted and special cased, so claim input using a more traditional way: Using a Clutter grab. This will also result in touch being cancelled on the Wayland side. This will happen along with other input, but that's actually a consistence improvemente, since the other method would not prevent other input (e.g. pointer) while the workspace gesture is ongoing. This results in glitchy behavior if multiple input devices are used simultaneously. Part-of: --- diff --git a/js/ui/workspaceAnimation.js b/js/ui/workspaceAnimation.js index 8d7b2594e..5bb2a10a7 100644 --- a/js/ui/workspaceAnimation.js +++ b/js/ui/workspaceAnimation.js @@ -405,11 +405,19 @@ export class WorkspaceAnimationController { } global.compositor.disable_unredirect(); + this._grab = Main.pushModal(global.stage, { + actionMode: Shell.ActionMode.NORMAL, + }); } _finishWorkspaceSwitch(switchData) { global.compositor.enable_unredirect(); + if (this._grab) { + Main.popModal(this._grab); + this._grab = null; + } + this._switchData = null; switchData.monitors.forEach(m => m.destroy());